# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=py3-anytree
_pkgname=anytree
pkgver=2.12.1
pkgrel=0
pkgdesc="Simple, lightweight and extensible Tree data structure"
url="https://github.com/c0fec0de/anytree"
arch="noarch"
license="Apache-2.0"
depends="py3-six"
makedepends="py3-gpep517 poetry"
checkdepends="py3-pytest graphviz"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/c0fec0de/anytree/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
02e8579122d7ca80e377abf4c41831ad347637acded66b73e24d212c06f03c61ca11c1a17cac54b87806b7eaf227ce0c128d4afeabcb20fb233a2da10497fa11  py3-anytree-2.12.1.tar.gz
"
